package org.fone.utils.task.data;

public enum  Operator {
    OP_GREATER(">",">"),
    OP_LESS("<","<"),
    OP_GREATER_EQUALS(">=",">="),
    OP_LESS_EQUALS("<=","<="),
    OP_EQUALS("==","=="),
    OP_NOT_EQUALS("!=","!="),
    OP_CONTAINS("contains","contains"),
    OP_NOT_CONTAINS("not contains","not contains"),
    OP_REGEX("regex","regex");

    public final String TYPE;
    public final String VALUE;

    public String getTYPE() {
        return TYPE;
    }

    public String getVALUE() {
        return VALUE;
    }

    Operator (String TYPE, String VALUE) {
        this.TYPE = TYPE;
        this.VALUE = VALUE;
    }
    public static Operator getTypeByValue(String value){
        if (null == value){
            return null;
        }
        for (Operator enums : Operator.values()) {
            if (enums.getVALUE().equals(value)) {
                return enums;
            }
        }
        return null;
    }
}
